﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="BookingView.aspx.cs" Inherits="AssignmentSWEN3.BookingView" %>
<%@ Register Assembly="DayPilot" Namespace="DayPilot.Web.Ui" TagPrefix="DayPilot" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>Delonix Regia Room Schedule</title>
    <script type="text/javascript" src="js/message.js"></script>
    <script type="text/javascript" src="js/modal.js"></script>
    <script type="text/javascript">

      var message = new DayPilot2.Message("message");
      message.hideAfter = 3000;

      var modal = new DayPilot.Modal();
      modal.top = 60;
      modal.width = 350;
      modal.opacity = 60;
      modal.border = "1px solid black";
      modal.closed = function () {
          if (this.result == "OK") {
              dps.commandCallBack('refresh');
          }
      };

      function createEvent(start, end, resource) {
          modal.height = 670;
          modal.showUrl("BookingViewNew.aspx?start=" + start.toStringSortable() + "&end=" + end.toStringSortable() + "&r=" + resource);
      }

      function editEvent(id) {
          modal.height = 590;
          modal.showUrl("BookingViewEdit.aspx?id=" + id);
      }

      function afterRender(data) {
          //new DayPilot2.Message("message").show(data);
          message.show(data, "message_warn");
      };

      function filter(property, value) {
          if (!dps.clientState.filter) {
              dps.clientState.filter = {};
          }
          if (dps.clientState.filter[property] != value) { // only refresh when the value has changed
              dps.clientState.filter[property] = value;
              dps.commandCallBack('filter');
          }
      }

	</script>
    <style type="text/css">
        .auto-style6
        {
            font-size: xx-large;
        }
        .auto-style7
        {
            font-size: medium;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <strong><span class="auto-style6">Booking and Reservation Schedule
    
    System
    
    <br />
    
    </span></strong>

     <span class="auto-style7">Show rooms:
    
    </span>

     <asp:DropDownList ID="DropDownListFilter" runat="server" OnChange="filter('room', this.value)">
        <asp:ListItem Text="All" Value="0"></asp:ListItem>
        <asp:ListItem Text="Single" Value="1"></asp:ListItem>
        <asp:ListItem Text="Double" Value="2"></asp:ListItem>
        <asp:ListItem Text="Triple" Value="3"></asp:ListItem>
        <asp:ListItem Text="Family" Value="4"></asp:ListItem>
        </asp:DropDownList>

    <DayPilot:DayPilotScheduler 
        ID="DayPilotScheduler1" 
        runat="server" 
        
        DataStartField="eventstart" 
        DataEndField="eventend" 
        DataTextField="name" 
        DataValueField="id" 
        DataResourceField="resource_id" 
        DataTagFields="status"
        
        RowHeaderColumnWidths="70,50,50"
        
        ClientObjectName="dps"
        
        CellGroupBy="Month"
        CellDuration="1440"
        Days="365"
        
        HeightSpec="Max"
        Height="600"
        Width="100%"
        EventHeight="35"
        HeaderFontSize="8pt"
        EventFontSize="8pt"
        
        EventMoveHandling="CallBack" 
        OnEventMove="DayPilotScheduler1_EventMove" 
        
        EventResizeHandling="CallBack"
        OnEventResize="DayPilotScheduler1_EventResize"
        
        TimeRangeSelectedHandling="JavaScript"
        TimeRangeSelectedJavaScript="createEvent(start, end, column);" 
        
        OnCommand="DayPilotScheduler1_Command"
        
        EventClickHandling="JavaScript"
        EventClickJavaScript="editEvent(e.value());" 
        
        AfterRenderJavaScript="afterRender(data);" 
        
        OnBeforeEventRender="DayPilotScheduler1_BeforeEventRender" 
        OnBeforeCellRender="DayPilotScheduler1_BeforeCellRender" style="text-align: center"
        >
    </DayPilot:DayPilotScheduler>

    <br />

    <div>
        <span id="message" style="padding:2px; display: none;" class="message_warn"></span>
    </div>
</asp:Content>
<asp:Content ID="Content3" runat="server" contentplaceholderid="ContentPlaceHolder2">
    <p>
        <asp:Button ID="Button1" runat="server" Height="40px" OnClick="Button1_Click" style="color: #FFCC00; background-color: #808080; font-size: large;" Text="Staff Management " Width="170px" />
</p>
    <p>
        <asp:Button ID="Button2" runat="server" Height="40px" OnClick="Button2_Click" style="color: #FFCC00; font-size: large; background-color: #666666" Text="Reporting" Width="170px" />
</p>
</asp:Content>

